\(\int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx\) [1099]

   Optimal result
   Rubi [A] (verified)
   Mathematica [A] (verified)
   Maple [B] (verified)
   Fricas [B] (verification not implemented)
   Sympy [A] (verification not implemented)
   Maxima [F(-2)]
   Giac [B] (verification not implemented)
   Mupad [B] (verification not implemented)

Optimal result

Integrand size = 28, antiderivative size = 354 \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\frac {\left (c^5+5 i c^4 d-10 c^3 d^2+30 i c^2 d^3+45 c d^4-15 i d^5\right ) x}{4 a^2 (c-i d)^3 (c+i d)^5}-\frac {2 d^3 \left (5 c^2-5 i c d-2 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{a^2 (i c-d)^5 (i c+d)^3 f}+\frac {d \left (c^2+5 i c d+8 d^2\right )}{4 a^2 (c-i d) (c+i d)^3 f (c+d \tan (e+f x))^2}+\frac {i c-5 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {(c-3 i d) d \left (c^2+8 i c d+5 d^2\right )}{4 a^2 (c-i d)^2 (c+i d)^4 f (c+d \tan (e+f x))} \]

[Out]

1/4*(c^5+5*I*c^4*d-10*c^3*d^2+30*I*c^2*d^3+45*c*d^4-15*I*d^5)*x/a^2/(c-I*d)^3/(c+I*d)^5-2*d^3*(5*c^2-5*I*c*d-2
*d^2)*ln(c*cos(f*x+e)+d*sin(f*x+e))/a^2/(I*c-d)^5/(I*c+d)^3/f+1/4*d*(c^2+5*I*c*d+8*d^2)/a^2/(c-I*d)/(c+I*d)^3/
f/(c+d*tan(f*x+e))^2+1/4*(I*c-5*d)/a^2/(c+I*d)^2/f/(1+I*tan(f*x+e))/(c+d*tan(f*x+e))^2-1/4/(I*c-d)/f/(a+I*a*ta
n(f*x+e))^2/(c+d*tan(f*x+e))^2+1/4*(c-3*I*d)*d*(c^2+8*I*c*d+5*d^2)/a^2/(c-I*d)^2/(c+I*d)^4/f/(c+d*tan(f*x+e))

Rubi [A] (verified)

Time = 0.87 (sec) , antiderivative size = 354, normalized size of antiderivative = 1.00, number of steps used = 6, number of rules used = 5, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.179, Rules used = {3640, 3677, 3610, 3612, 3611} \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\frac {d (c-3 i d) \left (c^2+8 i c d+5 d^2\right )}{4 a^2 f (c-i d)^2 (c+i d)^4 (c+d \tan (e+f x))}+\frac {d \left (c^2+5 i c d+8 d^2\right )}{4 a^2 f (c-i d) (c+i d)^3 (c+d \tan (e+f x))^2}-\frac {2 d^3 \left (5 c^2-5 i c d-2 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{a^2 f (-d+i c)^5 (d+i c)^3}+\frac {x \left (c^5+5 i c^4 d-10 c^3 d^2+30 i c^2 d^3+45 c d^4-15 i d^5\right )}{4 a^2 (c-i d)^3 (c+i d)^5}+\frac {-5 d+i c}{4 a^2 f (c+i d)^2 (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 f (-d+i c) (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2} \]

[In]

Int[1/((a + I*a*Tan[e + f*x])^2*(c + d*Tan[e + f*x])^3),x]

[Out]

((c^5 + (5*I)*c^4*d - 10*c^3*d^2 + (30*I)*c^2*d^3 + 45*c*d^4 - (15*I)*d^5)*x)/(4*a^2*(c - I*d)^3*(c + I*d)^5)
- (2*d^3*(5*c^2 - (5*I)*c*d - 2*d^2)*Log[c*Cos[e + f*x] + d*Sin[e + f*x]])/(a^2*(I*c - d)^5*(I*c + d)^3*f) + (
d*(c^2 + (5*I)*c*d + 8*d^2))/(4*a^2*(c - I*d)*(c + I*d)^3*f*(c + d*Tan[e + f*x])^2) + (I*c - 5*d)/(4*a^2*(c +
I*d)^2*f*(1 + I*Tan[e + f*x])*(c + d*Tan[e + f*x])^2) - 1/(4*(I*c - d)*f*(a + I*a*Tan[e + f*x])^2*(c + d*Tan[e
 + f*x])^2) + ((c - (3*I)*d)*d*(c^2 + (8*I)*c*d + 5*d^2))/(4*a^2*(c - I*d)^2*(c + I*d)^4*f*(c + d*Tan[e + f*x]
))

Rule 3610

Int[((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(b
*c - a*d)*((a + b*Tan[e + f*x])^(m + 1)/(f*(m + 1)*(a^2 + b^2))), x] + Dist[1/(a^2 + b^2), Int[(a + b*Tan[e +
f*x])^(m + 1)*Simp[a*c + b*d - (b*c - a*d)*Tan[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c
 - a*d, 0] && NeQ[a^2 + b^2, 0] && LtQ[m, -1]

Rule 3611

Int[((c_) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(c/(b*f))
*Log[RemoveContent[a*Cos[e + f*x] + b*Sin[e + f*x], x]], x] /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d,
0] && NeQ[a^2 + b^2, 0] && EqQ[a*c + b*d, 0]

Rule 3612

Int[((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])/((a_.) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[(a*c +
b*d)*(x/(a^2 + b^2)), x] + Dist[(b*c - a*d)/(a^2 + b^2), Int[(b - a*Tan[e + f*x])/(a + b*Tan[e + f*x]), x], x]
 /; FreeQ[{a, b, c, d, e, f}, x] && NeQ[b*c - a*d, 0] && NeQ[a^2 + b^2, 0] && NeQ[a*c + b*d, 0]

Rule 3640

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((c_.) + (d_.)*tan[(e_.) + (f_.)*(x_)])^(n_), x_Symbol] :> Sim
p[a*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(2*f*m*(b*c - a*d))), x] + Dist[1/(2*a*m*(b*c - a*d))
, Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Simp[b*c*m - a*d*(2*m + n + 1) + b*d*(m + n + 1)*Tan
[e + f*x], x], x], x] /; FreeQ[{a, b, c, d, e, f, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && NeQ[c^2
+ d^2, 0] && LtQ[m, 0] && (IntegerQ[m] || IntegersQ[2*m, 2*n])

Rule 3677

Int[((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)])^(m_)*((A_.) + (B_.)*tan[(e_.) + (f_.)*(x_)])*((c_.) + (d_.)*tan[(e_
.) + (f_.)*(x_)])^(n_), x_Symbol] :> Simp[(a*A + b*B)*(a + b*Tan[e + f*x])^m*((c + d*Tan[e + f*x])^(n + 1)/(2*
f*m*(b*c - a*d))), x] + Dist[1/(2*a*m*(b*c - a*d)), Int[(a + b*Tan[e + f*x])^(m + 1)*(c + d*Tan[e + f*x])^n*Si
mp[A*(b*c*m - a*d*(2*m + n + 1)) + B*(a*c*m - b*d*(n + 1)) + d*(A*b - a*B)*(m + n + 1)*Tan[e + f*x], x], x], x
] /; FreeQ[{a, b, c, d, e, f, A, B, n}, x] && NeQ[b*c - a*d, 0] && EqQ[a^2 + b^2, 0] && LtQ[m, 0] &&  !GtQ[n,
0]

Rubi steps \begin{align*} \text {integral}& = -\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}-\frac {\int \frac {-2 a (i c-3 d)-4 i a d \tan (e+f x)}{(a+i a \tan (e+f x)) (c+d \tan (e+f x))^3} \, dx}{4 a^2 (i c-d)} \\ & = \frac {i c-5 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}-\frac {\int \frac {-2 a^2 \left (c^2+5 i c d-16 d^2\right )-6 a^2 (c+5 i d) d \tan (e+f x)}{(c+d \tan (e+f x))^3} \, dx}{8 a^4 (c+i d)^2} \\ & = \frac {d \left (c^2+5 i c d+8 d^2\right )}{4 a^2 (c+i d)^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {i c-5 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}-\frac {\int \frac {-2 a^2 \left (c^3+5 i c^2 d-13 c d^2+15 i d^3\right )-4 a^2 d \left (c^2+5 i c d+8 d^2\right ) \tan (e+f x)}{(c+d \tan (e+f x))^2} \, dx}{8 a^4 (c+i d)^2 \left (c^2+d^2\right )} \\ & = \frac {d \left (c^2+5 i c d+8 d^2\right )}{4 a^2 (c+i d)^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {i c-5 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {(c-3 i d) d \left (c^2+8 i c d+5 d^2\right )}{4 a^2 (c-i d)^2 (c+i d)^4 f (c+d \tan (e+f x))}-\frac {\int \frac {-2 a^2 \left (c^4+5 i c^3 d-11 c^2 d^2+25 i c d^3+16 d^4\right )-2 a^2 d \left (c^3+5 i c^2 d+29 c d^2-15 i d^3\right ) \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{8 a^4 (c+i d)^2 \left (c^2+d^2\right )^2} \\ & = \frac {\left (c^5+5 i c^4 d-10 c^3 d^2+30 i c^2 d^3+45 c d^4-15 i d^5\right ) x}{4 a^2 (c+i d)^2 \left (c^2+d^2\right )^3}+\frac {d \left (c^2+5 i c d+8 d^2\right )}{4 a^2 (c+i d)^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {i c-5 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {(c-3 i d) d \left (c^2+8 i c d+5 d^2\right )}{4 a^2 (c-i d)^2 (c+i d)^4 f (c+d \tan (e+f x))}-\frac {\left (2 d^3 \left (5 c^2-5 i c d-2 d^2\right )\right ) \int \frac {d-c \tan (e+f x)}{c+d \tan (e+f x)} \, dx}{a^2 (c+i d)^2 \left (c^2+d^2\right )^3} \\ & = \frac {\left (c^5+5 i c^4 d-10 c^3 d^2+30 i c^2 d^3+45 c d^4-15 i d^5\right ) x}{4 a^2 (c+i d)^2 \left (c^2+d^2\right )^3}-\frac {2 d^3 \left (5 c^2-5 i c d-2 d^2\right ) \log (c \cos (e+f x)+d \sin (e+f x))}{a^2 (c+i d)^2 \left (c^2+d^2\right )^3 f}+\frac {d \left (c^2+5 i c d+8 d^2\right )}{4 a^2 (c+i d)^2 \left (c^2+d^2\right ) f (c+d \tan (e+f x))^2}+\frac {i c-5 d}{4 a^2 (c+i d)^2 f (1+i \tan (e+f x)) (c+d \tan (e+f x))^2}-\frac {1}{4 (i c-d) f (a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^2}+\frac {(c-3 i d) d \left (c^2+8 i c d+5 d^2\right )}{4 a^2 (c-i d)^2 (c+i d)^4 f (c+d \tan (e+f x))} \\ \end{align*}

Mathematica [A] (verified)

Time = 6.84 (sec) , antiderivative size = 336, normalized size of antiderivative = 0.95 \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=-\frac {\frac {2 i (c+i d)}{(-i+\tan (e+f x))^2 (c+d \tan (e+f x))^2}-\frac {2 (c+5 i d)}{(-i+\tan (e+f x)) (c+d \tan (e+f x))^2}-6 (c+5 i d) \left (-\frac {i \log (i-\tan (e+f x))}{2 (c+i d)^2}+\frac {i \log (i+\tan (e+f x))}{2 (c-i d)^2}+\frac {d \left (2 c \log (c+d \tan (e+f x))-\frac {c^2+d^2}{c+d \tan (e+f x)}\right )}{\left (c^2+d^2\right )^2}\right )+2 \left (c^2+5 i c d+8 d^2\right ) \left (\frac {\log (i-\tan (e+f x))}{(-i c+d)^3}+\frac {\log (i+\tan (e+f x))}{(i c+d)^3}+\frac {d \left (\left (6 c^2-2 d^2\right ) \log (c+d \tan (e+f x))-\frac {\left (c^2+d^2\right ) \left (5 c^2+d^2+4 c d \tan (e+f x)\right )}{(c+d \tan (e+f x))^2}\right )}{\left (c^2+d^2\right )^3}\right )}{8 a^2 (c+i d)^2 f} \]

[In]

Integrate[1/((a + I*a*Tan[e + f*x])^2*(c + d*Tan[e + f*x])^3),x]

[Out]

-1/8*(((2*I)*(c + I*d))/((-I + Tan[e + f*x])^2*(c + d*Tan[e + f*x])^2) - (2*(c + (5*I)*d))/((-I + Tan[e + f*x]
)*(c + d*Tan[e + f*x])^2) - 6*(c + (5*I)*d)*(((-1/2*I)*Log[I - Tan[e + f*x]])/(c + I*d)^2 + ((I/2)*Log[I + Tan
[e + f*x]])/(c - I*d)^2 + (d*(2*c*Log[c + d*Tan[e + f*x]] - (c^2 + d^2)/(c + d*Tan[e + f*x])))/(c^2 + d^2)^2)
+ 2*(c^2 + (5*I)*c*d + 8*d^2)*(Log[I - Tan[e + f*x]]/((-I)*c + d)^3 + Log[I + Tan[e + f*x]]/(I*c + d)^3 + (d*(
(6*c^2 - 2*d^2)*Log[c + d*Tan[e + f*x]] - ((c^2 + d^2)*(5*c^2 + d^2 + 4*c*d*Tan[e + f*x]))/(c + d*Tan[e + f*x]
)^2))/(c^2 + d^2)^3))/(a^2*(c + I*d)^2*f)

Maple [B] (verified)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 833 vs. \(2 (324 ) = 648\).

Time = 1.33 (sec) , antiderivative size = 834, normalized size of antiderivative = 2.36

method result size
derivativedivides \(\frac {2 i c d}{f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )}-\frac {i c^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {4 d^{3} c^{3}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}-\frac {4 d^{5} c}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}-\frac {i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{2}}{16 f \,a^{2} \left (i d +c \right )^{5}}+\frac {10 d^{3} \ln \left (c +d \tan \left (f x +e \right )\right ) c^{2}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5}}-\frac {4 d^{5} \ln \left (c +d \tan \left (f x +e \right )\right )}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5}}-\frac {d^{3} c^{4}}{2 f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {d^{5} c^{2}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {d^{7}}{2 f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )^{2}}+\frac {31 i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) d^{2}}{16 f \,a^{2} \left (i d +c \right )^{5}}+\frac {2 i d^{6}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}+\frac {c d}{2 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {10 i d^{4} \ln \left (c +d \tan \left (f x +e \right )\right ) c}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5}}+\frac {2 i d^{4} c^{2}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c d}{2 f \,a^{2} \left (i d +c \right )^{5}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c^{2}}{8 f \,a^{2} \left (i d +c \right )^{5}}-\frac {31 \arctan \left (\tan \left (f x +e \right )\right ) d^{2}}{8 f \,a^{2} \left (i d +c \right )^{5}}+\frac {i d^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {i \arctan \left (\tan \left (f x +e \right )\right ) c d}{f \,a^{2} \left (i d +c \right )^{5}}+\frac {c^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )}-\frac {7 d^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )}-\frac {i \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{16 f \,a^{2} \left (i d -c \right )^{3}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{8 f \,a^{2} \left (i d -c \right )^{3}}\) \(834\)
default \(\frac {2 i c d}{f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )}-\frac {i c^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {4 d^{3} c^{3}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}-\frac {4 d^{5} c}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}-\frac {i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c^{2}}{16 f \,a^{2} \left (i d +c \right )^{5}}+\frac {10 d^{3} \ln \left (c +d \tan \left (f x +e \right )\right ) c^{2}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5}}-\frac {4 d^{5} \ln \left (c +d \tan \left (f x +e \right )\right )}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5}}-\frac {d^{3} c^{4}}{2 f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {d^{5} c^{2}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )^{2}}-\frac {d^{7}}{2 f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )^{2}}+\frac {31 i \ln \left (1+\tan ^{2}\left (f x +e \right )\right ) d^{2}}{16 f \,a^{2} \left (i d +c \right )^{5}}+\frac {2 i d^{6}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}+\frac {c d}{2 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )^{2}}-\frac {10 i d^{4} \ln \left (c +d \tan \left (f x +e \right )\right ) c}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5}}+\frac {2 i d^{4} c^{2}}{f \,a^{2} \left (i d -c \right )^{3} \left (i d +c \right )^{5} \left (c +d \tan \left (f x +e \right )\right )}+\frac {\ln \left (1+\tan ^{2}\left (f x +e \right )\right ) c d}{2 f \,a^{2} \left (i d +c \right )^{5}}+\frac {\arctan \left (\tan \left (f x +e \right )\right ) c^{2}}{8 f \,a^{2} \left (i d +c \right )^{5}}-\frac {31 \arctan \left (\tan \left (f x +e \right )\right ) d^{2}}{8 f \,a^{2} \left (i d +c \right )^{5}}+\frac {i d^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )^{2}}+\frac {i \arctan \left (\tan \left (f x +e \right )\right ) c d}{f \,a^{2} \left (i d +c \right )^{5}}+\frac {c^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )}-\frac {7 d^{2}}{4 f \,a^{2} \left (i d +c \right )^{5} \left (\tan \left (f x +e \right )-i\right )}-\frac {i \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{16 f \,a^{2} \left (i d -c \right )^{3}}-\frac {\arctan \left (\tan \left (f x +e \right )\right )}{8 f \,a^{2} \left (i d -c \right )^{3}}\) \(834\)
risch \(-\frac {x}{4 a^{2} \left (3 i c^{2} d -i d^{3}-c^{3}+3 c \,d^{2}\right )}+\frac {i {\mathrm e}^{-2 i \left (f x +e \right )} c}{4 a^{2} \left (-i c +d \right )^{2} \left (-2 i c d -c^{2}+d^{2}\right ) f}-\frac {{\mathrm e}^{-2 i \left (f x +e \right )} d}{a^{2} \left (-i c +d \right )^{2} \left (-2 i c d -c^{2}+d^{2}\right ) f}+\frac {i {\mathrm e}^{-4 i \left (f x +e \right )}}{16 a^{2} \left (2 i c d +c^{2}-d^{2}\right ) \left (i d +c \right ) f}+\frac {20 d^{4} c x}{a^{2} \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}+\frac {20 d^{4} c e}{a^{2} f \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}+\frac {20 i d^{3} c^{2} x}{a^{2} \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}-\frac {8 i d^{5} x}{a^{2} \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}+\frac {20 i d^{3} c^{2} e}{a^{2} f \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}-\frac {8 i d^{5} e}{a^{2} f \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}-\frac {2 d^{4} \left (6 i c d \,{\mathrm e}^{2 i \left (f x +e \right )}-5 c^{2} {\mathrm e}^{2 i \left (f x +e \right )}+d^{2} {\mathrm e}^{2 i \left (f x +e \right )}-3 i c d -5 c^{2}-2 d^{2}\right )}{\left (-i c +d \right )^{4} \left ({\mathrm e}^{2 i \left (f x +e \right )} d +i c \,{\mathrm e}^{2 i \left (f x +e \right )}-d +i c \right )^{2} f \,a^{2} \left (i c +d \right )^{3}}+\frac {10 i d^{4} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) c}{a^{2} f \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}-\frac {10 d^{3} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right ) c^{2}}{a^{2} f \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}+\frac {4 d^{5} \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}-\frac {i d +c}{i d -c}\right )}{a^{2} f \left (2 i c^{7} d +6 i c^{5} d^{3}+6 i c^{3} d^{5}+2 i c \,d^{7}+c^{8}+2 c^{6} d^{2}-2 c^{2} d^{6}-d^{8}\right )}\) \(1011\)
norman \(\text {Expression too large to display}\) \(1498\)

[In]

int(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x,method=_RETURNVERBOSE)

[Out]

2*I/f/a^2/(c+I*d)^5/(tan(f*x+e)-I)*c*d-1/4*I/f/a^2/(c+I*d)^5/(tan(f*x+e)-I)^2*c^2-4/f/a^2*d^3/(I*d-c)^3/(c+I*d
)^5/(c+d*tan(f*x+e))*c^3-4/f/a^2*d^5/(I*d-c)^3/(c+I*d)^5/(c+d*tan(f*x+e))*c-1/16*I/f/a^2/(c+I*d)^5*ln(1+tan(f*
x+e)^2)*c^2+10/f/a^2*d^3/(I*d-c)^3/(c+I*d)^5*ln(c+d*tan(f*x+e))*c^2-4/f/a^2*d^5/(I*d-c)^3/(c+I*d)^5*ln(c+d*tan
(f*x+e))-1/2/f/a^2*d^3/(I*d-c)^3/(c+I*d)^5/(c+d*tan(f*x+e))^2*c^4-1/f/a^2*d^5/(I*d-c)^3/(c+I*d)^5/(c+d*tan(f*x
+e))^2*c^2-1/2/f/a^2*d^7/(I*d-c)^3/(c+I*d)^5/(c+d*tan(f*x+e))^2+31/16*I/f/a^2/(c+I*d)^5*ln(1+tan(f*x+e)^2)*d^2
+2*I/f/a^2*d^6/(I*d-c)^3/(c+I*d)^5/(c+d*tan(f*x+e))+1/2/f/a^2/(c+I*d)^5/(tan(f*x+e)-I)^2*c*d-10*I/f/a^2*d^4/(I
*d-c)^3/(c+I*d)^5*ln(c+d*tan(f*x+e))*c+2*I/f/a^2*d^4/(I*d-c)^3/(c+I*d)^5/(c+d*tan(f*x+e))*c^2+1/2/f/a^2/(c+I*d
)^5*ln(1+tan(f*x+e)^2)*c*d+1/8/f/a^2/(c+I*d)^5*arctan(tan(f*x+e))*c^2-31/8/f/a^2/(c+I*d)^5*arctan(tan(f*x+e))*
d^2+1/4*I/f/a^2/(c+I*d)^5/(tan(f*x+e)-I)^2*d^2+I/f/a^2/(c+I*d)^5*arctan(tan(f*x+e))*c*d+1/4/f/a^2/(c+I*d)^5/(t
an(f*x+e)-I)*c^2-7/4/f/a^2/(c+I*d)^5/(tan(f*x+e)-I)*d^2-1/16*I/f/a^2/(I*d-c)^3*ln(1+tan(f*x+e)^2)-1/8/f/a^2/(I
*d-c)^3*arctan(tan(f*x+e))

Fricas [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 907 vs. \(2 (304) = 608\).

Time = 0.28 (sec) , antiderivative size = 907, normalized size of antiderivative = 2.56 \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\frac {i \, c^{7} - c^{6} d + 3 i \, c^{5} d^{2} - 3 \, c^{4} d^{3} + 3 i \, c^{3} d^{4} - 3 \, c^{2} d^{5} + i \, c d^{6} - d^{7} + 4 \, {\left (c^{7} + 3 i \, c^{6} d - c^{5} d^{2} + 85 i \, c^{4} d^{3} + 235 \, c^{3} d^{4} - 271 i \, c^{2} d^{5} - 147 \, c d^{6} + 31 i \, d^{7}\right )} f x e^{\left (8 i \, f x + 8 i \, e\right )} - 4 \, {\left (-i \, c^{7} - 11 i \, c^{5} d^{2} - 20 \, c^{4} d^{3} + 45 i \, c^{3} d^{4} - 8 \, c^{2} d^{5} + 55 i \, c d^{6} + 12 \, d^{7} - 2 \, {\left (c^{7} + 5 i \, c^{6} d - 9 \, c^{5} d^{2} + 75 i \, c^{4} d^{3} + 75 \, c^{3} d^{4} + 39 i \, c^{2} d^{5} + 85 \, c d^{6} - 31 i \, d^{7}\right )} f x\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (9 i \, c^{7} - 13 \, c^{6} d + 71 i \, c^{5} d^{2} + 5 \, c^{4} d^{3} - 45 i \, c^{3} d^{4} + 305 \, c^{2} d^{5} + 85 i \, c d^{6} + 95 \, d^{7} + 4 \, {\left (c^{7} + 7 i \, c^{6} d - 21 \, c^{5} d^{2} + 45 i \, c^{4} d^{3} - 45 \, c^{3} d^{4} + 69 i \, c^{2} d^{5} - 23 \, c d^{6} + 31 i \, d^{7}\right )} f x\right )} e^{\left (4 i \, f x + 4 i \, e\right )} - 2 \, {\left (-3 i \, c^{7} + 7 \, c^{6} d - 9 i \, c^{5} d^{2} + 21 \, c^{4} d^{3} - 9 i \, c^{3} d^{4} + 21 \, c^{2} d^{5} - 3 i \, c d^{6} + 7 \, d^{7}\right )} e^{\left (2 i \, f x + 2 i \, e\right )} - 32 \, {\left ({\left (5 \, c^{4} d^{3} - 15 i \, c^{3} d^{4} - 17 \, c^{2} d^{5} + 9 i \, c d^{6} + 2 \, d^{7}\right )} e^{\left (8 i \, f x + 8 i \, e\right )} + 2 \, {\left (5 \, c^{4} d^{3} - 5 i \, c^{3} d^{4} + 3 \, c^{2} d^{5} - 5 i \, c d^{6} - 2 \, d^{7}\right )} e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (5 \, c^{4} d^{3} + 5 i \, c^{3} d^{4} + 3 \, c^{2} d^{5} + i \, c d^{6} + 2 \, d^{7}\right )} e^{\left (4 i \, f x + 4 i \, e\right )}\right )} \log \left (\frac {{\left (i \, c + d\right )} e^{\left (2 i \, f x + 2 i \, e\right )} + i \, c - d}{i \, c + d}\right )}{16 \, {\left ({\left (a^{2} c^{10} + 5 \, a^{2} c^{8} d^{2} + 10 \, a^{2} c^{6} d^{4} + 10 \, a^{2} c^{4} d^{6} + 5 \, a^{2} c^{2} d^{8} + a^{2} d^{10}\right )} f e^{\left (8 i \, f x + 8 i \, e\right )} + 2 \, {\left (a^{2} c^{10} + 2 i \, a^{2} c^{9} d + 3 \, a^{2} c^{8} d^{2} + 8 i \, a^{2} c^{7} d^{3} + 2 \, a^{2} c^{6} d^{4} + 12 i \, a^{2} c^{5} d^{5} - 2 \, a^{2} c^{4} d^{6} + 8 i \, a^{2} c^{3} d^{7} - 3 \, a^{2} c^{2} d^{8} + 2 i \, a^{2} c d^{9} - a^{2} d^{10}\right )} f e^{\left (6 i \, f x + 6 i \, e\right )} + {\left (a^{2} c^{10} + 4 i \, a^{2} c^{9} d - 3 \, a^{2} c^{8} d^{2} + 8 i \, a^{2} c^{7} d^{3} - 14 \, a^{2} c^{6} d^{4} - 14 \, a^{2} c^{4} d^{6} - 8 i \, a^{2} c^{3} d^{7} - 3 \, a^{2} c^{2} d^{8} - 4 i \, a^{2} c d^{9} + a^{2} d^{10}\right )} f e^{\left (4 i \, f x + 4 i \, e\right )}\right )}} \]

[In]

integrate(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x, algorithm="fricas")

[Out]

1/16*(I*c^7 - c^6*d + 3*I*c^5*d^2 - 3*c^4*d^3 + 3*I*c^3*d^4 - 3*c^2*d^5 + I*c*d^6 - d^7 + 4*(c^7 + 3*I*c^6*d -
 c^5*d^2 + 85*I*c^4*d^3 + 235*c^3*d^4 - 271*I*c^2*d^5 - 147*c*d^6 + 31*I*d^7)*f*x*e^(8*I*f*x + 8*I*e) - 4*(-I*
c^7 - 11*I*c^5*d^2 - 20*c^4*d^3 + 45*I*c^3*d^4 - 8*c^2*d^5 + 55*I*c*d^6 + 12*d^7 - 2*(c^7 + 5*I*c^6*d - 9*c^5*
d^2 + 75*I*c^4*d^3 + 75*c^3*d^4 + 39*I*c^2*d^5 + 85*c*d^6 - 31*I*d^7)*f*x)*e^(6*I*f*x + 6*I*e) + (9*I*c^7 - 13
*c^6*d + 71*I*c^5*d^2 + 5*c^4*d^3 - 45*I*c^3*d^4 + 305*c^2*d^5 + 85*I*c*d^6 + 95*d^7 + 4*(c^7 + 7*I*c^6*d - 21
*c^5*d^2 + 45*I*c^4*d^3 - 45*c^3*d^4 + 69*I*c^2*d^5 - 23*c*d^6 + 31*I*d^7)*f*x)*e^(4*I*f*x + 4*I*e) - 2*(-3*I*
c^7 + 7*c^6*d - 9*I*c^5*d^2 + 21*c^4*d^3 - 9*I*c^3*d^4 + 21*c^2*d^5 - 3*I*c*d^6 + 7*d^7)*e^(2*I*f*x + 2*I*e) -
 32*((5*c^4*d^3 - 15*I*c^3*d^4 - 17*c^2*d^5 + 9*I*c*d^6 + 2*d^7)*e^(8*I*f*x + 8*I*e) + 2*(5*c^4*d^3 - 5*I*c^3*
d^4 + 3*c^2*d^5 - 5*I*c*d^6 - 2*d^7)*e^(6*I*f*x + 6*I*e) + (5*c^4*d^3 + 5*I*c^3*d^4 + 3*c^2*d^5 + I*c*d^6 + 2*
d^7)*e^(4*I*f*x + 4*I*e))*log(((I*c + d)*e^(2*I*f*x + 2*I*e) + I*c - d)/(I*c + d)))/((a^2*c^10 + 5*a^2*c^8*d^2
 + 10*a^2*c^6*d^4 + 10*a^2*c^4*d^6 + 5*a^2*c^2*d^8 + a^2*d^10)*f*e^(8*I*f*x + 8*I*e) + 2*(a^2*c^10 + 2*I*a^2*c
^9*d + 3*a^2*c^8*d^2 + 8*I*a^2*c^7*d^3 + 2*a^2*c^6*d^4 + 12*I*a^2*c^5*d^5 - 2*a^2*c^4*d^6 + 8*I*a^2*c^3*d^7 -
3*a^2*c^2*d^8 + 2*I*a^2*c*d^9 - a^2*d^10)*f*e^(6*I*f*x + 6*I*e) + (a^2*c^10 + 4*I*a^2*c^9*d - 3*a^2*c^8*d^2 +
8*I*a^2*c^7*d^3 - 14*a^2*c^6*d^4 - 14*a^2*c^4*d^6 - 8*I*a^2*c^3*d^7 - 3*a^2*c^2*d^8 - 4*I*a^2*c*d^9 + a^2*d^10
)*f*e^(4*I*f*x + 4*I*e))

Sympy [A] (verification not implemented)

Time = 87.44 (sec) , antiderivative size = 1583, normalized size of antiderivative = 4.47 \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\frac {x \left (c^{2} + 8 i c d - 31 d^{2}\right )}{4 a^{2} c^{5} + 20 i a^{2} c^{4} d - 40 a^{2} c^{3} d^{2} - 40 i a^{2} c^{2} d^{3} + 20 a^{2} c d^{4} + 4 i a^{2} d^{5}} + \frac {- 10 i c^{2} d^{4} + 6 c d^{5} - 4 i d^{6} + \left (- 10 i c^{2} d^{4} e^{2 i e} - 12 c d^{5} e^{2 i e} + 2 i d^{6} e^{2 i e}\right ) e^{2 i f x}}{a^{2} c^{9} f + 3 i a^{2} c^{8} d f + 8 i a^{2} c^{6} d^{3} f - 6 a^{2} c^{5} d^{4} f + 6 i a^{2} c^{4} d^{5} f - 8 a^{2} c^{3} d^{6} f - 3 a^{2} c d^{8} f - i a^{2} d^{9} f + \left (2 a^{2} c^{9} f e^{2 i e} + 2 i a^{2} c^{8} d f e^{2 i e} + 8 a^{2} c^{7} d^{2} f e^{2 i e} + 8 i a^{2} c^{6} d^{3} f e^{2 i e} + 12 a^{2} c^{5} d^{4} f e^{2 i e} + 12 i a^{2} c^{4} d^{5} f e^{2 i e} + 8 a^{2} c^{3} d^{6} f e^{2 i e} + 8 i a^{2} c^{2} d^{7} f e^{2 i e} + 2 a^{2} c d^{8} f e^{2 i e} + 2 i a^{2} d^{9} f e^{2 i e}\right ) e^{2 i f x} + \left (a^{2} c^{9} f e^{4 i e} - i a^{2} c^{8} d f e^{4 i e} + 4 a^{2} c^{7} d^{2} f e^{4 i e} - 4 i a^{2} c^{6} d^{3} f e^{4 i e} + 6 a^{2} c^{5} d^{4} f e^{4 i e} - 6 i a^{2} c^{4} d^{5} f e^{4 i e} + 4 a^{2} c^{3} d^{6} f e^{4 i e} - 4 i a^{2} c^{2} d^{7} f e^{4 i e} + a^{2} c d^{8} f e^{4 i e} - i a^{2} d^{9} f e^{4 i e}\right ) e^{4 i f x}} + \begin {cases} \frac {\left (4 i a^{2} c^{4} f e^{2 i e} - 16 a^{2} c^{3} d f e^{2 i e} - 24 i a^{2} c^{2} d^{2} f e^{2 i e} + 16 a^{2} c d^{3} f e^{2 i e} + 4 i a^{2} d^{4} f e^{2 i e}\right ) e^{- 4 i f x} + \left (16 i a^{2} c^{4} f e^{4 i e} - 112 a^{2} c^{3} d f e^{4 i e} - 240 i a^{2} c^{2} d^{2} f e^{4 i e} + 208 a^{2} c d^{3} f e^{4 i e} + 64 i a^{2} d^{4} f e^{4 i e}\right ) e^{- 2 i f x}}{64 a^{4} c^{7} f^{2} e^{6 i e} + 448 i a^{4} c^{6} d f^{2} e^{6 i e} - 1344 a^{4} c^{5} d^{2} f^{2} e^{6 i e} - 2240 i a^{4} c^{4} d^{3} f^{2} e^{6 i e} + 2240 a^{4} c^{3} d^{4} f^{2} e^{6 i e} + 1344 i a^{4} c^{2} d^{5} f^{2} e^{6 i e} - 448 a^{4} c d^{6} f^{2} e^{6 i e} - 64 i a^{4} d^{7} f^{2} e^{6 i e}} & \text {for}\: 64 a^{4} c^{7} f^{2} e^{6 i e} + 448 i a^{4} c^{6} d f^{2} e^{6 i e} - 1344 a^{4} c^{5} d^{2} f^{2} e^{6 i e} - 2240 i a^{4} c^{4} d^{3} f^{2} e^{6 i e} + 2240 a^{4} c^{3} d^{4} f^{2} e^{6 i e} + 1344 i a^{4} c^{2} d^{5} f^{2} e^{6 i e} - 448 a^{4} c d^{6} f^{2} e^{6 i e} - 64 i a^{4} d^{7} f^{2} e^{6 i e} \neq 0 \\x \left (- \frac {c^{2} + 8 i c d - 31 d^{2}}{4 a^{2} c^{5} + 20 i a^{2} c^{4} d - 40 a^{2} c^{3} d^{2} - 40 i a^{2} c^{2} d^{3} + 20 a^{2} c d^{4} + 4 i a^{2} d^{5}} + \frac {c^{2} e^{4 i e} + 2 c^{2} e^{2 i e} + c^{2} + 8 i c d e^{4 i e} + 10 i c d e^{2 i e} + 2 i c d - 31 d^{2} e^{4 i e} - 8 d^{2} e^{2 i e} - d^{2}}{4 a^{2} c^{5} e^{4 i e} + 20 i a^{2} c^{4} d e^{4 i e} - 40 a^{2} c^{3} d^{2} e^{4 i e} - 40 i a^{2} c^{2} d^{3} e^{4 i e} + 20 a^{2} c d^{4} e^{4 i e} + 4 i a^{2} d^{5} e^{4 i e}}\right ) & \text {otherwise} \end {cases} - \frac {2 d^{3} \cdot \left (5 c^{2} - 5 i c d - 2 d^{2}\right ) \log {\left (\frac {c + i d}{c e^{2 i e} - i d e^{2 i e}} + e^{2 i f x} \right )}}{a^{2} f \left (c - i d\right )^{3} \left (c + i d\right )^{5}} \]

[In]

integrate(1/(a+I*a*tan(f*x+e))**2/(c+d*tan(f*x+e))**3,x)

[Out]

x*(c**2 + 8*I*c*d - 31*d**2)/(4*a**2*c**5 + 20*I*a**2*c**4*d - 40*a**2*c**3*d**2 - 40*I*a**2*c**2*d**3 + 20*a*
*2*c*d**4 + 4*I*a**2*d**5) + (-10*I*c**2*d**4 + 6*c*d**5 - 4*I*d**6 + (-10*I*c**2*d**4*exp(2*I*e) - 12*c*d**5*
exp(2*I*e) + 2*I*d**6*exp(2*I*e))*exp(2*I*f*x))/(a**2*c**9*f + 3*I*a**2*c**8*d*f + 8*I*a**2*c**6*d**3*f - 6*a*
*2*c**5*d**4*f + 6*I*a**2*c**4*d**5*f - 8*a**2*c**3*d**6*f - 3*a**2*c*d**8*f - I*a**2*d**9*f + (2*a**2*c**9*f*
exp(2*I*e) + 2*I*a**2*c**8*d*f*exp(2*I*e) + 8*a**2*c**7*d**2*f*exp(2*I*e) + 8*I*a**2*c**6*d**3*f*exp(2*I*e) +
12*a**2*c**5*d**4*f*exp(2*I*e) + 12*I*a**2*c**4*d**5*f*exp(2*I*e) + 8*a**2*c**3*d**6*f*exp(2*I*e) + 8*I*a**2*c
**2*d**7*f*exp(2*I*e) + 2*a**2*c*d**8*f*exp(2*I*e) + 2*I*a**2*d**9*f*exp(2*I*e))*exp(2*I*f*x) + (a**2*c**9*f*e
xp(4*I*e) - I*a**2*c**8*d*f*exp(4*I*e) + 4*a**2*c**7*d**2*f*exp(4*I*e) - 4*I*a**2*c**6*d**3*f*exp(4*I*e) + 6*a
**2*c**5*d**4*f*exp(4*I*e) - 6*I*a**2*c**4*d**5*f*exp(4*I*e) + 4*a**2*c**3*d**6*f*exp(4*I*e) - 4*I*a**2*c**2*d
**7*f*exp(4*I*e) + a**2*c*d**8*f*exp(4*I*e) - I*a**2*d**9*f*exp(4*I*e))*exp(4*I*f*x)) + Piecewise((((4*I*a**2*
c**4*f*exp(2*I*e) - 16*a**2*c**3*d*f*exp(2*I*e) - 24*I*a**2*c**2*d**2*f*exp(2*I*e) + 16*a**2*c*d**3*f*exp(2*I*
e) + 4*I*a**2*d**4*f*exp(2*I*e))*exp(-4*I*f*x) + (16*I*a**2*c**4*f*exp(4*I*e) - 112*a**2*c**3*d*f*exp(4*I*e) -
 240*I*a**2*c**2*d**2*f*exp(4*I*e) + 208*a**2*c*d**3*f*exp(4*I*e) + 64*I*a**2*d**4*f*exp(4*I*e))*exp(-2*I*f*x)
)/(64*a**4*c**7*f**2*exp(6*I*e) + 448*I*a**4*c**6*d*f**2*exp(6*I*e) - 1344*a**4*c**5*d**2*f**2*exp(6*I*e) - 22
40*I*a**4*c**4*d**3*f**2*exp(6*I*e) + 2240*a**4*c**3*d**4*f**2*exp(6*I*e) + 1344*I*a**4*c**2*d**5*f**2*exp(6*I
*e) - 448*a**4*c*d**6*f**2*exp(6*I*e) - 64*I*a**4*d**7*f**2*exp(6*I*e)), Ne(64*a**4*c**7*f**2*exp(6*I*e) + 448
*I*a**4*c**6*d*f**2*exp(6*I*e) - 1344*a**4*c**5*d**2*f**2*exp(6*I*e) - 2240*I*a**4*c**4*d**3*f**2*exp(6*I*e) +
 2240*a**4*c**3*d**4*f**2*exp(6*I*e) + 1344*I*a**4*c**2*d**5*f**2*exp(6*I*e) - 448*a**4*c*d**6*f**2*exp(6*I*e)
 - 64*I*a**4*d**7*f**2*exp(6*I*e), 0)), (x*(-(c**2 + 8*I*c*d - 31*d**2)/(4*a**2*c**5 + 20*I*a**2*c**4*d - 40*a
**2*c**3*d**2 - 40*I*a**2*c**2*d**3 + 20*a**2*c*d**4 + 4*I*a**2*d**5) + (c**2*exp(4*I*e) + 2*c**2*exp(2*I*e) +
 c**2 + 8*I*c*d*exp(4*I*e) + 10*I*c*d*exp(2*I*e) + 2*I*c*d - 31*d**2*exp(4*I*e) - 8*d**2*exp(2*I*e) - d**2)/(4
*a**2*c**5*exp(4*I*e) + 20*I*a**2*c**4*d*exp(4*I*e) - 40*a**2*c**3*d**2*exp(4*I*e) - 40*I*a**2*c**2*d**3*exp(4
*I*e) + 20*a**2*c*d**4*exp(4*I*e) + 4*I*a**2*d**5*exp(4*I*e))), True)) - 2*d**3*(5*c**2 - 5*I*c*d - 2*d**2)*lo
g((c + I*d)/(c*exp(2*I*e) - I*d*exp(2*I*e)) + exp(2*I*f*x))/(a**2*f*(c - I*d)**3*(c + I*d)**5)

Maxima [F(-2)]

Exception generated. \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\text {Exception raised: RuntimeError} \]

[In]

integrate(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x, algorithm="maxima")

[Out]

Exception raised: RuntimeError >> ECL says: expt: undefined: 0 to a negative exponent.

Giac [B] (verification not implemented)

Both result and optimal contain complex but leaf count of result is larger than twice the leaf count of optimal. 772 vs. \(2 (304) = 608\).

Time = 0.81 (sec) , antiderivative size = 772, normalized size of antiderivative = 2.18 \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\frac {\frac {16 \, {\left (5 i \, c^{2} d^{4} + 5 \, c d^{5} - 2 i \, d^{6}\right )} \log \left (d \tan \left (f x + e\right ) + c\right )}{-i \, a^{2} c^{8} d + 2 \, a^{2} c^{7} d^{2} - 2 i \, a^{2} c^{6} d^{3} + 6 \, a^{2} c^{5} d^{4} + 6 \, a^{2} c^{3} d^{6} + 2 i \, a^{2} c^{2} d^{7} + 2 \, a^{2} c d^{8} + i \, a^{2} d^{9}} - \frac {{\left (i \, c^{2} - 8 \, c d - 31 i \, d^{2}\right )} \log \left (\tan \left (f x + e\right ) - i\right )}{a^{2} c^{5} + 5 i \, a^{2} c^{4} d - 10 \, a^{2} c^{3} d^{2} - 10 i \, a^{2} c^{2} d^{3} + 5 \, a^{2} c d^{4} + i \, a^{2} d^{5}} - \frac {16 \, \log \left (\tan \left (f x + e\right ) + i\right )}{16 i \, a^{2} c^{3} + 48 \, a^{2} c^{2} d - 48 i \, a^{2} c d^{2} - 16 \, a^{2} d^{3}} + \frac {16 \, {\left (3 \, c^{4} d^{2} \tan \left (f x + e\right )^{4} + 12 i \, c^{3} d^{3} \tan \left (f x + e\right )^{4} - 18 \, c^{2} d^{4} \tan \left (f x + e\right )^{4} - 12 i \, c d^{5} \tan \left (f x + e\right )^{4} + 3 \, d^{6} \tan \left (f x + e\right )^{4} + 6 \, c^{5} d \tan \left (f x + e\right )^{3} + 10 i \, c^{4} d^{2} \tan \left (f x + e\right )^{3} + 20 \, c^{3} d^{3} \tan \left (f x + e\right )^{3} - 260 i \, c^{2} d^{4} \tan \left (f x + e\right )^{3} - 370 \, c d^{5} \tan \left (f x + e\right )^{3} + 114 i \, d^{6} \tan \left (f x + e\right )^{3} + 3 \, c^{6} \tan \left (f x + e\right )^{2} - 16 i \, c^{5} d \tan \left (f x + e\right )^{2} + 75 \, c^{4} d^{2} \tan \left (f x + e\right )^{2} - 400 i \, c^{3} d^{3} \tan \left (f x + e\right )^{2} - 955 \, c^{2} d^{4} \tan \left (f x + e\right )^{2} + 720 i \, c d^{5} \tan \left (f x + e\right )^{2} + 173 \, d^{6} \tan \left (f x + e\right )^{2} - 14 i \, c^{6} \tan \left (f x + e\right ) + 18 \, c^{5} d \tan \left (f x + e\right ) - 164 i \, c^{4} d^{2} \tan \left (f x + e\right ) - 724 \, c^{3} d^{3} \tan \left (f x + e\right ) + 970 i \, c^{2} d^{4} \tan \left (f x + e\right ) + 410 \, c d^{5} \tan \left (f x + e\right ) - 32 i \, d^{6} \tan \left (f x + e\right ) - 19 \, c^{6} - 28 i \, c^{5} d - 126 \, c^{4} d^{2} + 332 i \, c^{3} d^{3} + 269 \, c^{2} d^{4} - 48 i \, c d^{5} + 16 \, d^{6}\right )}}{-64 \, {\left (i \, a^{2} c^{7} - a^{2} c^{6} d + 3 i \, a^{2} c^{5} d^{2} - 3 \, a^{2} c^{4} d^{3} + 3 i \, a^{2} c^{3} d^{4} - 3 \, a^{2} c^{2} d^{5} + i \, a^{2} c d^{6} - a^{2} d^{7}\right )} {\left (d \tan \left (f x + e\right )^{2} + c \tan \left (f x + e\right ) - i \, d \tan \left (f x + e\right ) - i \, c\right )}^{2}}}{8 \, f} \]

[In]

integrate(1/(a+I*a*tan(f*x+e))^2/(c+d*tan(f*x+e))^3,x, algorithm="giac")

[Out]

1/8*(16*(5*I*c^2*d^4 + 5*c*d^5 - 2*I*d^6)*log(d*tan(f*x + e) + c)/(-I*a^2*c^8*d + 2*a^2*c^7*d^2 - 2*I*a^2*c^6*
d^3 + 6*a^2*c^5*d^4 + 6*a^2*c^3*d^6 + 2*I*a^2*c^2*d^7 + 2*a^2*c*d^8 + I*a^2*d^9) - (I*c^2 - 8*c*d - 31*I*d^2)*
log(tan(f*x + e) - I)/(a^2*c^5 + 5*I*a^2*c^4*d - 10*a^2*c^3*d^2 - 10*I*a^2*c^2*d^3 + 5*a^2*c*d^4 + I*a^2*d^5)
- 16*log(tan(f*x + e) + I)/(16*I*a^2*c^3 + 48*a^2*c^2*d - 48*I*a^2*c*d^2 - 16*a^2*d^3) + 16*(3*c^4*d^2*tan(f*x
 + e)^4 + 12*I*c^3*d^3*tan(f*x + e)^4 - 18*c^2*d^4*tan(f*x + e)^4 - 12*I*c*d^5*tan(f*x + e)^4 + 3*d^6*tan(f*x
+ e)^4 + 6*c^5*d*tan(f*x + e)^3 + 10*I*c^4*d^2*tan(f*x + e)^3 + 20*c^3*d^3*tan(f*x + e)^3 - 260*I*c^2*d^4*tan(
f*x + e)^3 - 370*c*d^5*tan(f*x + e)^3 + 114*I*d^6*tan(f*x + e)^3 + 3*c^6*tan(f*x + e)^2 - 16*I*c^5*d*tan(f*x +
 e)^2 + 75*c^4*d^2*tan(f*x + e)^2 - 400*I*c^3*d^3*tan(f*x + e)^2 - 955*c^2*d^4*tan(f*x + e)^2 + 720*I*c*d^5*ta
n(f*x + e)^2 + 173*d^6*tan(f*x + e)^2 - 14*I*c^6*tan(f*x + e) + 18*c^5*d*tan(f*x + e) - 164*I*c^4*d^2*tan(f*x
+ e) - 724*c^3*d^3*tan(f*x + e) + 970*I*c^2*d^4*tan(f*x + e) + 410*c*d^5*tan(f*x + e) - 32*I*d^6*tan(f*x + e)
- 19*c^6 - 28*I*c^5*d - 126*c^4*d^2 + 332*I*c^3*d^3 + 269*c^2*d^4 - 48*I*c*d^5 + 16*d^6)/((-64*I*a^2*c^7 + 64*
a^2*c^6*d - 192*I*a^2*c^5*d^2 + 192*a^2*c^4*d^3 - 192*I*a^2*c^3*d^4 + 192*a^2*c^2*d^5 - 64*I*a^2*c*d^6 + 64*a^
2*d^7)*(d*tan(f*x + e)^2 + c*tan(f*x + e) - I*d*tan(f*x + e) - I*c)^2))/f

Mupad [B] (verification not implemented)

Time = 13.46 (sec) , antiderivative size = 2640, normalized size of antiderivative = 7.46 \[ \int \frac {1}{(a+i a \tan (e+f x))^2 (c+d \tan (e+f x))^3} \, dx=\text {Too large to display} \]

[In]

int(1/((a + a*tan(e + f*x)*1i)^2*(c + d*tan(e + f*x))^3),x)

[Out]

symsum(log((a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*(839*c*d^7 + c^7*d - d^8*24
0i + c^2*d^6*970i - 353*c^3*d^5 + c^4*d^4*100i - 7*c^5*d^3 + c^6*d^2*10i) - root(5760*a^6*c^8*d^8*e^3 + 4096*a
^6*c^10*d^6*e^3 + 4096*a^6*c^6*d^10*e^3 - a^6*c^11*d^5*e^3*2304i + a^6*c^5*d^11*e^3*2304i - a^6*c^13*d^3*e^3*1
280i - a^6*c^9*d^7*e^3*1280i + a^6*c^7*d^9*e^3*1280i + a^6*c^3*d^13*e^3*1280i + 1280*a^6*c^12*d^4*e^3 + 1280*a
^6*c^4*d^12*e^3 - a^6*c^15*d*e^3*256i + a^6*c*d^15*e^3*256i - 64*a^6*d^16*e^3 - 64*a^6*c^16*e^3 + a^2*c*d^9*e*
5190i - a^2*c^9*d*e*10i - a^2*c^3*d^7*e*12600i - 11565*a^2*c^2*d^8*e + 6450*a^2*c^4*d^6*e + a^2*c^5*d^5*e*180i
 + 110*a^2*c^6*d^4*e + a^2*c^7*d^3*e*40i + 45*a^2*c^8*d^2*e + 993*a^2*d^10*e - a^2*c^10*e + 234*c^2*d^5 - c^3*
d^4*70i - 10*c^4*d^3 - c*d^6*278i - 124*d^7, e, k)*(root(5760*a^6*c^8*d^8*e^3 + 4096*a^6*c^10*d^6*e^3 + 4096*a
^6*c^6*d^10*e^3 - a^6*c^11*d^5*e^3*2304i + a^6*c^5*d^11*e^3*2304i - a^6*c^13*d^3*e^3*1280i - a^6*c^9*d^7*e^3*1
280i + a^6*c^7*d^9*e^3*1280i + a^6*c^3*d^13*e^3*1280i + 1280*a^6*c^12*d^4*e^3 + 1280*a^6*c^4*d^12*e^3 - a^6*c^
15*d*e^3*256i + a^6*c*d^15*e^3*256i - 64*a^6*d^16*e^3 - 64*a^6*c^16*e^3 + a^2*c*d^9*e*5190i - a^2*c^9*d*e*10i
- a^2*c^3*d^7*e*12600i - 11565*a^2*c^2*d^8*e + 6450*a^2*c^4*d^6*e + a^2*c^5*d^5*e*180i + 110*a^2*c^6*d^4*e + a
^2*c^7*d^3*e*40i + 45*a^2*c^8*d^2*e + 993*a^2*d^10*e - a^2*c^10*e + 234*c^2*d^5 - c^3*d^4*70i - 10*c^4*d^3 - c
*d^6*278i - 124*d^7, e, k)*((a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*(a^4*c^2*d
^12*512i - 128*a^4*c^13*d - 128*a^4*c*d^13 + 256*a^4*c^3*d^11 + a^4*c^4*d^10*1536i + 2176*a^4*c^5*d^9 + a^4*c^
6*d^8*1024i + 3584*a^4*c^7*d^7 - a^4*c^8*d^6*1024i + 2176*a^4*c^9*d^5 - a^4*c^10*d^4*1536i + 256*a^4*c^11*d^3
- a^4*c^12*d^2*512i) + tan(e + f*x)*(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*(3
2*a^4*c^14 - 96*a^4*d^14 + a^4*c*d^13*384i + a^4*c^13*d*128i + 224*a^4*c^2*d^12 + a^4*c^3*d^11*1024i + 1568*a^
4*c^4*d^10 + a^4*c^5*d^9*384i + 2144*a^4*c^6*d^8 - a^4*c^7*d^7*1024i + 736*a^4*c^8*d^6 - a^4*c^9*d^5*896i - 35
2*a^4*c^10*d^4 - 160*a^4*c^12*d^2)) + (a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*
(a^2*d^11*60i - 4*a^2*c^11 + 68*a^2*c*d^10 - a^2*c^10*d*28i + a^2*c^2*d^9*244i + 300*a^2*c^3*d^8 + a^2*c^4*d^7
*344i + 488*a^2*c^5*d^6 + a^2*c^6*d^5*168i + 344*a^2*c^7*d^4 - a^2*c^8*d^3*20i + 84*a^2*c^9*d^2) + tan(e + f*x
)*(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*c^3*d^3*4i + a^2*c^4*d^2)*(192*a^2*d^11 - a^2*c*d^10*24i - 8*a
^2*c^10*d + 664*a^2*c^2*d^9 + a^2*c^3*d^8*128i + 1088*a^2*c^4*d^7 + a^2*c^5*d^6*272i + 944*a^2*c^6*d^5 + a^2*c
^7*d^4*64i + 320*a^2*c^8*d^3 - a^2*c^9*d^2*56i)) + tan(e + f*x)*(a^2*d^6 + a^2*c*d^5*4i - 6*a^2*c^2*d^4 - a^2*
c^3*d^3*4i + a^2*c^4*d^2)*(991*c^2*d^6 - 225*d^8 - c*d^7*870i + c^3*d^5*260i + 33*c^4*d^4 + c^5*d^3*10i + c^6*
d^2))*root(5760*a^6*c^8*d^8*e^3 + 4096*a^6*c^10*d^6*e^3 + 4096*a^6*c^6*d^10*e^3 - a^6*c^11*d^5*e^3*2304i + a^6
*c^5*d^11*e^3*2304i - a^6*c^13*d^3*e^3*1280i - a^6*c^9*d^7*e^3*1280i + a^6*c^7*d^9*e^3*1280i + a^6*c^3*d^13*e^
3*1280i + 1280*a^6*c^12*d^4*e^3 + 1280*a^6*c^4*d^12*e^3 - a^6*c^15*d*e^3*256i + a^6*c*d^15*e^3*256i - 64*a^6*d
^16*e^3 - 64*a^6*c^16*e^3 + a^2*c*d^9*e*5190i - a^2*c^9*d*e*10i - a^2*c^3*d^7*e*12600i - 11565*a^2*c^2*d^8*e +
 6450*a^2*c^4*d^6*e + a^2*c^5*d^5*e*180i + 110*a^2*c^6*d^4*e + a^2*c^7*d^3*e*40i + 45*a^2*c^8*d^2*e + 993*a^2*
d^10*e - a^2*c^10*e + 234*c^2*d^5 - c^3*d^4*70i - 10*c^4*d^3 - c*d^6*278i - 124*d^7, e, k), k, 1, 3)/f - ((tan
(e + f*x)^3*(29*c*d^2 + c^2*d*5i + c^3 - d^3*15i)*1i)/(4*a^2*(2*c*d^5 + 2*c^5*d - c^6*1i + d^6*1i + c^2*d^4*1i
 + 4*c^3*d^3 - c^4*d^2*1i)) - ((c^5*8i - 16*c^4*d - c*d^4*32i + 8*d^5 + 104*c^2*d^3 + c^3*d^2*56i)*1i)/(16*a^2
*d^2*(2*c*d^5 + 2*c^5*d - c^6*1i + d^6*1i + c^2*d^4*1i + 4*c^3*d^3 - c^4*d^2*1i)) + (tan(e + f*x)^2*(c^3*d*16i
 - c*d^3*136i + 4*c^4 - 44*d^4 + 96*c^2*d^2)*1i)/(8*a^2*d*(2*c*d^5 + 2*c^5*d - c^6*1i + d^6*1i + c^2*d^4*1i +
4*c^3*d^3 - c^4*d^2*1i)) + (tan(e + f*x)*(c^4*d*3i - 144*c*d^4 + 3*c^5 + d^5*12i - c^2*d^3*213i + 63*c^3*d^2)*
1i)/(12*a^2*d^2*(2*c*d^5 + 2*c^5*d - c^6*1i + d^6*1i + c^2*d^4*1i + 4*c^3*d^3 - c^4*d^2*1i)))/(f*(tan(e + f*x)
^3*((2*c)/d - 2i) + tan(e + f*x)^2*((c^2 - d^2)/d^2 - (c*4i)/d) - tan(e + f*x)*((2*c)/d + (c^2*2i)/d^2) + tan(
e + f*x)^4 - c^2/d^2))